// 用户模块
export default {
  namespaced: true,
  state () {
    return {
      // 用户信息
      profile: {
        id: '',
        avatar: '',
        nickname: '',
        account: '',
        mobile: '',
        token: ''
      },
      // 登陆后跳转地址
      redirectUrl: '/'
    }
  },
  mutations: {
    /**
     * 1. 修改用户信息
     * @param {*} state
     * @param {*} payload 用户信息对象
     */
    SET_USER (state, payload) {
      state.profile = payload
    },

    SET_REDIRECT_URL (state, payload) {
      state.redirectUrl = payload
    }
  }
}
